<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Elasticsearch 滚动升级完全指南</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .card-hover {
            transition: all 0.3s ease;
            border: 1px solid transparent;
        }
        
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
            border-color: #667eea;
        }
        
        .step-number {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            font-weight: bold;
            flex-shrink: 0;
        }
        
        .highlight-box {
            background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
            border-left: 4px solid #e17055;
            padding: 1rem 1.5rem;
            margin: 1.5rem 0;
            border-radius: 0.5rem;
        }
        
        .section-title {
            position: relative;
            padding-bottom: 0.5rem;
            margin-bottom: 2rem;
        }
        
        .section-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 60px;
            height: 3px;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            border-radius: 2px;
        }
        
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        
        .icon-box {
            width: 60px;
            height: 60px;
            background: rgba(102, 126, 234, 0.1);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 1rem;
        }
        
        .icon-box i {
            font-size: 24px;
            color: #667eea;
        }
        
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .animate-fadeInUp {
            animation: fadeInUp 0.6s ease-out;
        }
        
        .process-timeline {
            position: relative;
            padding-left: 3rem;
        }
        
        .process-timeline::before {
            content: '';
            position: absolute;
            left: 20px;
            top: 20px;
            bottom: 20px;
            width: 2px;
            background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
        }
        
        .timeline-item {
            position: relative;
            margin-bottom: 2rem;
        }
        
        .timeline-dot {
            position: absolute;
            left: -31px;
            top: 5px;
            width: 12px;
            height: 12px;
            background: #667eea;
            border-radius: 50%;
            border: 3px solid white;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <div class="hero-gradient text-white">
        <div class="container mx-auto px-6 py-20">
            <div class="max-w-4xl mx-auto text-center animate-fadeInUp">
                <h1 class="text-5xl font-bold mb-6">Elasticsearch 滚动升级</h1>
                <p class="text-xl opacity-90 leading-relaxed">零停机时间的集群升级艺术，确保业务连续性的最佳实践</p>
                <div class="mt-8 flex justify-center space-x-6">
                    <div class="flex items-center">
                        <i class="fas fa-server mr-2"></i>
                        <span>逐节点升级</span>
                    </div>
                    <div class="flex items-center">
                        <i class="fas fa-shield-alt mr-2"></i>
                        <span>数据安全保障</span>
                    </div>
                    <div class="flex items-center">
                        <i class="fas fa-chart-line mr-2"></i>
                        <span>业务零影响</span>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Main Content -->
    <div class="container mx-auto px-6 py-12">
        <!-- Introduction Card -->
        <div class="max-w-6xl mx-auto mb-12">
            <div class="bg-white rounded-2xl shadow-xl p-8 card-hover">
                <div class="icon-box">
                    <i class="fas fa-info-circle"></i>
                </div>
                <h2 class="text-2xl font-bold text-gray-800 mb-4">什么是滚动升级？</h2>
                <p class="text-gray-600 leading-relaxed text-lg">
                    Elasticsearch 的滚动升级（Rolling Upgrade）是一种逐步升级集群的方式，旨在避免全量停机并减少对业务的影响。在滚动升级过程中，集群中的节点会逐个被升级，而在每个节点升级的过程中，集群的其余部分仍然可以继续提供服务。
                </p>
            </div>
        </div>

        <!-- Process Visualization -->
        <div class="max-w-6xl mx-auto mb-12">
            <h2 class="text-3xl font-bold text-gray-800 section-title">升级流程可视化</h2>
            <div class="bg-white rounded-2xl shadow-xl p-8">
                <div class="mermaid">
                    graph LR
                        A[开始升级] --> B[准备阶段]
                        B --> C[备份数据]
                        C --> D[检查兼容性]
                        D --> E[升级配置]
                        E --> F[升级插件]
                        F --> G[逐个节点升级]
                        G --> H{所有节点完成?}
                        H -->|否| G
                        H -->|是| I[验证集群状态]
                        I --> J[升级完成]
                        
                        style A fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
                        style J fill:#48bb78,stroke:#fff,stroke-width:2px,color:#fff
                        style B fill:#ffeaa7,stroke:#fdcb6e,stroke-width:2px
                        style C fill:#ffeaa7,stroke:#fdcb6e,stroke-width:2px
                        style D fill:#ffeaa7,stroke:#fdcb6e,stroke-width:2px
                        style E fill:#74b9ff,stroke:#0984e3,stroke-width:2px
                        style F fill:#74b9ff,stroke:#0984e3,stroke-width:2px
                        style G fill:#a29bfe,stroke:#6c5ce7,stroke-width:2px
                        style I fill:#55efc4,stroke:#00b894,stroke-width:2px
                </div>
            </div>
        </div>

        <!-- Main Process Steps -->
        <div class="max-w-6xl mx-auto grid md:grid-cols-3 gap-8 mb-12">
            <!-- Step 1: Preparation -->
            <div class="bg-white rounded-2xl shadow-xl p-8 card-hover">
                <div class="flex items-start mb-6">
                    <div class="step-number">1</div>
                    <h3 class="text-2xl font-bold text-gray-800 ml-4">准备升级</h3>
                </div>
                <div class="space-y-4">
                    <div class="flex items-start">
                        <i class="fas fa-database text-purple-600 mt-1 mr-3"></i>
                        <div>
                            <h4 class="font-semibold text-gray-700">备份数据</h4>
                            <p class="text-gray-600 text-sm mt-1">在进行升级之前，确保已对数据进行备份，以防止在升级过程中发生数据丢失或其他问题。</p>
                        </div>
                    </div>
                    <div class="flex items-start">
                        <i class="fas fa-check-circle text-purple-600 mt-1 mr-3"></i>
                        <div>
                            <h4 class="font-semibold text-gray-700">检查兼容性</h4>
                            <p class="text-gray-600 text-sm mt-1">确认升级版本之间的兼容性，确保现有数据和配置在新版本中也能正常工作。</p>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Step 2: Upgrade Process -->
            <div class="bg-white rounded-2xl shadow-xl p-8 card-hover">
                <div class="flex items-start mb-6">
                    <div class="step-number">2</div>
                    <h3 class="text-2xl font-bold text-gray-800 ml-4">升级集群节点</h3>
                </div>
                <div class="space-y-4">
                    <div class="flex items-start">
                        <i class="fas fa-cog text-purple-600 mt-1 mr-3"></i>
                        <div>
                            <h4 class="font-semibold text-gray-700">升级配置</h4>
                            <p class="text-gray-600 text-sm mt-1">在所有节点上更新配置文件以适应新版本的要求。</p>
                        </div>
                    </div>
                    <div class="flex items-start">
                        <i class="fas fa-plug text-purple-600 mt-1 mr-3"></i>
                        <div>
                            <h4 class="font-semibold text-gray-700">升级插件</h4>
                            <p class="text-gray-600 text-sm mt-1">升级所有在集群中使用的插件，确保兼容性。</p>
                        </div>
                    </div>
                    <div class="flex items-start">
                        <i class="fas fa-sync-alt text-purple-600 mt-1 mr-3"></i>
                        <div>
                            <h4 class="font-semibold text-gray-700">逐个节点升级</h4>
                            <p class="text-gray-600 text-sm mt-1">按照特定顺序逐个升级节点，保持服务可用性。</p>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Step 3: Completion -->
            <div class="bg-white rounded-2xl shadow-xl p-8 card-hover">
                <div class="flex items-start mb-6">
                    <div class="step-number">3</div>
                    <h3 class="text-2xl font-bold text-gray-800 ml-4">完成升级</h3>
                </div>
                <div class="space-y-4">
                    <div class="flex items-start">
                        <i class="fas fa-heartbeat text-purple-600 mt-1 mr-3"></i>
                        <div>
                            <h4 class="font-semibold text-gray-700">验证集群状态</h4>
                            <p class="text-gray-600 text-sm mt-1">检查集群的状态，确保集群的健康状态为"绿色"或"黄色"。</p>
                        </div>
                    </div>
                    <div class="flex items-start">
                        <i class="fas fa-clipboard-check text-purple-600 mt-1 mr-3"></i>
                        <div>
                            <h4 class="font-semibold text-gray-700">检查兼容性</h4>
                            <p class="text-gray-600 text-sm mt-1">验证数据的完整性和应用程序的兼容性。</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Detailed Node Upgrade Process -->
        <div class="max-w-6xl mx-auto mb-12">
            <h2 class="text-3xl font-bold text-gray-800 section-title">节点升级详细步骤</h2>
            <div class="bg-white rounded-2xl shadow-xl p-8">
                <div class="process-timeline">
                    <div class="timeline-item">
                        <div class="timeline-dot"></div>
                        <div class="bg-gray-50 rounded-lg p-6">
                            <h4 class="font-bold text-lg text-gray-800 mb-2">
                                <i class="fas fa-stop-circle text-red-500 mr-2"></i>停止节点
                            </h4>
                            <p class="text-gray-600">停止当前节点的服务，但确保在升级之前，节点的状态为"关闭"状态。通常，这可以通过在集群中逐步剥离节点来实现。</p